package com.hzhr.iot.log.util.generator;

import com.hzhr.iot.core.annotation.CygProperty;
import com.hzhr.iot.core.annotation.CygQuery;
import com.hzhr.iot.core.annotation.CygQuerys;
import com.hzhr.iot.core.util.HzhrFileUtil;
import com.hzhr.iot.core.util.HzhrStringUtils;
import com.hzhr.iot.log.util.ReflectUtil;
import org.springframework.util.StringUtils;

import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.util.*;

public class ConvertorGenerator {
    private static String projectName = "log-service";


    public static void main(String[] args) throws Exception {
        File directory = new File("");//设定为当前文件夹
        String rootPath = directory.getCanonicalPath();
        String srcRootPath = rootPath + "\\" + projectName + "\\src\\main\\java\\" + ConvertorGenerator.class.getPackage().getName().replace(".util.generator", "").replace(".", "\\");

        String rootPackageName = ConvertorGenerator.class.getPackage().getName().replace(".util.generator", "");


        List<File> files = HzhrFileUtil.getFiles(srcRootPath + "\\entity");


        for (File file : files) {//遍历example
            String fileName = file.getName();
            if (fileName.endsWith("Entity.java")) {
                String resourceName = fileName.substring(0, fileName.lastIndexOf("Entity.java"));
                String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);

                Class entityClass = Class.forName(rootPackageName + ".entity." + resourceName + "Entity");
                Class extClass = null;
                try {
                    extClass = Class.forName(rootPackageName + ".entity.ext." + resourceName + "EntityExt");
                } catch (Exception e) {

                }
                Class withBlobClass = null;
                try {
                    withBlobClass = Class.forName(rootPackageName + ".entity." + resourceName + "EntityWithBLOBs");
                } catch (Exception e) {

                }
                Class modelClass = null;
                try {
                    modelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "Model");
                } catch (Exception e) {

                }
                Class postModelClass = null;
                try {
                    postModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PostModel");
                } catch (Exception e) {

                }
                Class putModelClass = null;
                try {
                    putModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PutModel");
                } catch (Exception e) {

                }
                Class patchModelClass = null;
                try {
                    patchModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PatchModel");
                } catch (Exception e) {

                }
                Class dto_addClass = null;
                try {
                    dto_addClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_add");
                } catch (Exception e) {

                }
                Class dto_setClass = null;
                try {
                    dto_setClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_set");
                } catch (Exception e) {

                }
                Class addDtoClass = null;
                try {
                    addDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "AddDto");
                } catch (Exception e) {

                }
                Class setDtoClass = null;
                try {
                    setDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "SetDto");
                } catch (Exception e) {

                }
                Class delDtoClass = null;
                try {
                    delDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".del." + resourceName + "DelRequestDto");
                } catch (Exception e) {

                }
                Class setPropsDtoClass = null;
                try {
                    setPropsDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".setProps." + resourceName + "SetPropsRequestDto");
                } catch (Exception e) {

                }
                Class getDtoClass = null;
                try {
                    getDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".get." + resourceName + "GetRequestDto");
                } catch (Exception e) {

                }
                Class getByIdDtoClass = null;
                try {
                    getByIdDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".getById." + resourceName + "GetByIdRequestDto");
                } catch (Exception e) {

                }
                Class getCountDtoClass = null;
                try {
                    getCountDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".getCount." + resourceName + "GetCountRequestDto");
                } catch (Exception e) {

                }

                StringBuilder sb = new StringBuilder();
                StringBuilder importSb = new StringBuilder();
                importSb.append("package " + rootPackageName + ".convertor;\n\n");
                importSb.append("import " + rootPackageName + ".convertor.custom.*;\n");
                importSb.append("import com.hzhr.iot.core.util.HzhrTypeUtil;\n");
                importSb.append("import com.hzhr.iot.core.util.HzhrJsonUtil;\n");
                importSb.append("import java.util.Map;\n");
                if (modelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "Model;\n");
                }
                if (postModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PostModel;\n");
                }
                if (putModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PutModel;\n");
                }
                if (patchModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PatchModel;\n");
                }
                if (dto_addClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_add;\n");
                }
                if (dto_setClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_set;\n");
                }
                if (addDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "AddDto;\n");
                }
                if (setDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "SetDto;\n");
                }
                if (delDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".del." + resourceName + "DelRequestDto;\n");
                }
                if (getDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".get." + resourceName + "GetRequestDto;\n");
                }
                if (getByIdDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".getById." + resourceName + "GetByIdRequestDto;\n");
                }
                if (getCountDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".getCount." + resourceName + "GetCountRequestDto;\n");
                }
                if (setPropsDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".setProps." + resourceName + "SetPropsRequestDto;\n");
                }
                importSb.append("import " + rootPackageName + ".entity." + resourceName + "Entity;\n");
                if (extClass != null) {
                    importSb.append("import " + rootPackageName + ".entity.ext." + resourceName + "EntityExt;\n");
                }
                if (withBlobClass != null) {
                    importSb.append("import " + withBlobClass.getName() + ";\n");
                }
                //importSb.append("import " + rootPackageName + ".queryModel.custom." + resourceName + "CustomQueryModel;\n");
                importSb.append("import org.springframework.beans.factory.annotation.Autowired;\n");
                importSb.append("import org.springframework.stereotype.Component;\n");
                importSb.append("import java.util.ArrayList;\n");
                importSb.append("import java.util.Date;\n");
                importSb.append("import java.util.List;\n");

                StringBuilder autowireSb = new StringBuilder();
                for (File file1 : files) {//遍历example
                    String fileName1 = file1.getName();
                    if (fileName1.endsWith("Entity.java")) {
                        String resourceName1 = fileName1.substring(0, fileName1.lastIndexOf("Entity.java"));
                        if (resourceName.equals(resourceName1)) continue;
                        String resourceNameFl1 = HzhrStringUtils.firstCharToLowerCase(resourceName1);
                        autowireSb.append("    @Autowired\n");
                        autowireSb.append("    " + resourceName1 + "CustomConvertor " + resourceNameFl1 + "CustomConvertor;\n");
                    }
                }
                StringBuilder functionSb = new StringBuilder();



                if (postModelClass != null) {
                    functionSb.append("    public " + resourceName + "Entity postModel2entity(" + resourceName + "PostModel in) {\n");
                    functionSb.append(generate(postModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public List<" + resourceName + "Entity> postModelList2entityList(List<" + resourceName + "PostModel> in) {\n");
                    functionSb.append("        if (in == null) return null;\n");
                    functionSb.append("        List<" + resourceName + "Entity> result = new ArrayList<>();\n");
                    functionSb.append("        for (" + resourceName + "PostModel item : in) {\n");
                    functionSb.append("            result.add(postModel2entity(item));\n");
                    functionSb.append("        }\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");

                    if (withBlobClass != null) {
                        functionSb.append("    public " + resourceName + "EntityWithBLOBs postModel2withBLOBs(" + resourceName + "PostModel in) {\n");
                        functionSb.append(generate(postModelClass, withBlobClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + resourceName + "EntityWithBLOBs> postModelList2withBLOBsList(List<" + resourceName + "PostModel> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + resourceName + "EntityWithBLOBs> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + resourceName + "PostModel item : in) {\n");
                        functionSb.append("            result.add(postModel2withBLOBs(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");
                    }
                }

                if (putModelClass != null) {
                    functionSb.append("    public void putModel2entity(" + resourceName + "Entity result, " + resourceName + "PutModel in) {\n");
                    functionSb.append(generate1(putModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");

                    if (withBlobClass != null) {
                        functionSb.append("    public void putModel2withBLOBs(" + resourceName + "EntityWithBLOBs result, " + resourceName + "PutModel in) {\n");
                        functionSb.append(generate1(putModelClass, withBlobClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                    }
//                    functionSb.append("    public void putModelList2entityList(List<" + resourceName + "Entity> result, List<" + resourceName + "PutModel> in) {\n");
//                    functionSb.append("        if (result == null || result.size() == 0) return;\n");
//                    functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
//                    functionSb.append("            " + resourceName + "PutModel ini = in.get(i);\n");
//                    functionSb.append("            Integer id = ini.getId();\n");
//                    functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
//                    functionSb.append("                if (item.getId() == id) {\n");
//                    functionSb.append("                    putModel2entity(item, ini);\n");
//                    functionSb.append("                    break;\n");
//                    functionSb.append("                }\n");
//                    functionSb.append("            }\n");
//                    functionSb.append("        }\n");
//                    functionSb.append("    }\n");
                }

                if (patchModelClass != null) {
                    functionSb.append("    public void patchModel2entity(" + resourceName + "Entity result, " + resourceName + "PatchModel in) {\n");
                    functionSb.append(generate2(patchModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public void patchModelList2entityList(List<" + resourceName + "Entity> result, List<" + resourceName + "PatchModel> in) {\n");
                    functionSb.append("        if (result == null || result.size() == 0) return;\n");
                    functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
                    functionSb.append("            " + resourceName + "PatchModel ini = in.get(i);\n");
                    functionSb.append("            Integer id = ini.getId();\n");
                    functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
                    functionSb.append("                if (item.getId() == id) {\n");
                    functionSb.append("                    patchModel2entity(item, ini);\n");
                    functionSb.append("                    break;\n");
                    functionSb.append("                }\n");
                    functionSb.append("            }\n");
                    functionSb.append("        }\n");
                    functionSb.append("    }\n");

                    if (withBlobClass != null) {
                        functionSb.append("    public void patchModel2withBLOBs(" + resourceName + "EntityWithBLOBs result, " + resourceName + "PatchModel in) {\n");
                        functionSb.append(generate2(patchModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public void patchModelList2withBLOBsList(List<" + resourceName + "EntityWithBLOBs> result, List<" + resourceName + "PatchModel> in) {\n");
                        functionSb.append("        if (result == null || result.size() == 0) return;\n");
                        functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
                        functionSb.append("            " + resourceName + "PatchModel ini = in.get(i);\n");
                        functionSb.append("            Integer id = ini.getId();\n");
                        functionSb.append("            for (" + resourceName + "EntityWithBLOBs item : result) {\n");
                        functionSb.append("                if (item.getId() == id) {\n");
                        functionSb.append("                    patchModel2withBLOBs(item, ini);\n");
                        functionSb.append("                    break;\n");
                        functionSb.append("                }\n");
                        functionSb.append("            }\n");
                        functionSb.append("        }\n");
                        functionSb.append("    }\n");
                    }
                }

                Set<Class<?>> classes = ReflectUtil.getClasses(rootPackageName + ".model." + resourceNameFl);
                String postModelName = resourceName + "PostModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(postModelName) && clazzName.endsWith(postModelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(postModelName));
                        functionSb.append("    public " + resourceName + "Entity " + pre + "postModel2entity(" + clazzName + " in) {\n");
                        functionSb.append(generate(clazz, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + resourceName + "Entity> " + pre + "postModelList2entityList(List<" + clazzName + "> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + resourceName + "Entity> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + clazzName + " item : in) {\n");
                        functionSb.append("            result.add(" + pre + "postModel2entity(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");
                    }
                }

                String putModelName = resourceName + "PutModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(putModelName) && clazzName.endsWith(putModelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(putModelName));
                        functionSb.append("    public void " + pre + "putModel2entity(" + resourceName + "Entity result, " + clazzName + " in) {\n");
                        functionSb.append(generate1(clazz, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
//                        functionSb.append("    public void " + pre + "putModelList2entityList(List<" + resourceName + "Entity> result, List<" + clazzName + "> in) {\n");
//                        functionSb.append("        if (in == null) return;\n");
//                        functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
//                        functionSb.append("            " + clazzName + " ini = in.get(i);\n");
//                        functionSb.append("            Integer id = ini.getId();\n");
//                        functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
//                        functionSb.append("                if (item.getId() == id) {\n");
//                        functionSb.append("                    " + pre + "putModel2entity(item, ini);\n");
//                        functionSb.append("                    break;\n");
//                        functionSb.append("                }\n");
//                        functionSb.append("            }\n");
//                        functionSb.append("        }\n");
//                        functionSb.append("    }\n");
                    }
                }

                String patchModelName = resourceName + "PatchModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(patchModelName) && clazzName.endsWith(patchModelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(patchModelName));
                        functionSb.append("    public void " + pre + "patchModel2entity(" + resourceName + "Entity result, " + clazzName + " in) {\n");
                        functionSb.append(generate1(putModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public void patchModelList2entityList(List<" + resourceName + "Entity> result, List<" + clazzName + "> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
                        functionSb.append("            " + clazzName + " ini = in.get(i);\n");
                        functionSb.append("            Integer id = ini.getId();\n");
                        functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
                        functionSb.append("                if (item.getId() == id) {\n");
                        functionSb.append("                    patchModel2entity(item, ini);\n");
                        functionSb.append("                    break;\n");
                        functionSb.append("                }\n");
                        functionSb.append("            }\n");
                        functionSb.append("        }\n");
                        functionSb.append("    }\n");
                    }
                }

                functionSb.append("\n");

                if (modelClass != null) {
                    functionSb.append("    public " + resourceName + "Model entity2model(" + resourceName + "Entity in) {\n");
                    functionSb.append(generate(entityClass, modelClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public List<" + resourceName + "Model> entityList2modelList(List<" + resourceName + "Entity> in) {\n");
                    functionSb.append("        if (in == null) return null;\n");
                    functionSb.append("        List<" + resourceName + "Model> result = new ArrayList<>();\n");
                    functionSb.append("        for (" + resourceName + "Entity item : in) {\n");
                    functionSb.append("            result.add(entity2model(item));\n");
                    functionSb.append("        }\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");

                    functionSb.append("    public " + resourceName + "Model ext2model(" + resourceName + "EntityExt in) {\n");
                    functionSb.append(generate(extClass, modelClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public List<" + resourceName + "Model> extList2modelList(List<" + resourceName + "EntityExt> in) {\n");
                    functionSb.append("        if (in == null) return null;\n");
                    functionSb.append("        List<" + resourceName + "Model> result = new ArrayList<>();\n");
                    functionSb.append("        for (" + resourceName + "EntityExt item : in) {\n");
                    functionSb.append("            result.add(ext2model(item));\n");
                    functionSb.append("        }\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");

                    if (withBlobClass != null) {
                        functionSb.append("    public " + resourceName + "Model withBLOBs2model(" + resourceName + "EntityWithBLOBs in) {\n");
                        functionSb.append(generate(withBlobClass, modelClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + resourceName + "Model> withBLOBsList2modelList(List<" + resourceName + "EntityWithBLOBs> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + resourceName + "Model> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + resourceName + "EntityWithBLOBs item : in) {\n");
                        functionSb.append("            result.add(withBLOBs2model(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");
                    }
                }

                String modelName = resourceName + "Model";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();
                    if (!clazzName.equals(modelName) && clazzName.endsWith(modelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(modelName));
                        functionSb.append("    public " + clazzName + " " + pre + "entity2model(" + resourceName + "Entity in) {\n");
                        functionSb.append(generate(entityClass, clazz, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + clazzName + "> " + pre + "entityList2modelList(List<" + resourceName + "Entity> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + clazzName + "> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + resourceName + "Entity item : in) {\n");
                        functionSb.append("            result.add(" + pre + "entity2model(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");

                        functionSb.append("    public " + clazzName + " " + pre + "ext2model(" + resourceName + "EntityExt in) {\n");
                        functionSb.append(generate(extClass, clazz, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + clazzName + "> " + pre + "extList2modelList(List<" + resourceName + "EntityExt> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + clazzName + "> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + resourceName + "EntityExt item : in) {\n");
                        functionSb.append("            result.add(" + pre + "ext2model(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");
                    }
                }

                functionSb.append("\n");
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();
                    if (!clazzName.equals(modelName) && clazzName.endsWith(modelName)) {
                        String classSimpleName = clazz.getSimpleName();
                        String[] classSimpleNameSplit = classSimpleName.split("_");
                        String firstName = classSimpleNameSplit[0];
                        String secondModel = classSimpleNameSplit[1].substring(0, classSimpleNameSplit[1].lastIndexOf("Model"));

                        Class<?> customQueryModelClass = null;
                        try {
                            customQueryModelClass = Class.forName(rootPackageName + ".queryModel.custom." + secondModel + "CustomQueryModel");
                        } catch (Exception e) {

                        }

                        if (customQueryModelClass != null) {
                            importSb.append("import " + customQueryModelClass.getName() + ";\n");
                            functionSb.append("    public " + secondModel + "CustomQueryModel " + firstName + "_query2queryModel(Map<String, Object> query) {\n");
                            functionSb.append("        " + secondModel + "CustomQueryModel queryModel = new " + secondModel + "CustomQueryModel();\n");
                            functionSb.append("\n");

                            Class<?> controllerClass = null;
                            try {
                                controllerClass = Class.forName(rootPackageName + ".controller." + secondModel + "Controller");
                            } catch (Exception e) {

                            }
                            if (controllerClass != null) {
                                CygQuerys cygQuerys = controllerClass.getAnnotation(CygQuerys.class);
                                if (cygQuerys != null) {
                                    CygQuery[] cygQueries = cygQuerys.value();
                                    for (CygQuery cygQuery : cygQueries) {
                                        String name = cygQuery.name();
                                        String query = cygQuery.query();
                                        Class<?> type = cygQuery.type();

                                        functionSb.append("        " + type.getSimpleName() + " " + name + " = HzhrTypeUtil.object2" + HzhrStringUtils.firstCharToLowerCase(type.getSimpleName()) + "(query.get(\"" + name + "\"));\n");
                                        functionSb.append("        if (" + name + " != null) {\n");
                                        functionSb.append("            queryModel.set" + HzhrStringUtils.firstCharToUppserCase(query) + "(" + name + ");\n");
                                        functionSb.append("         }\n");
                                        functionSb.append("\n");
                                    }
                                }
                            }

                            Map<String, List<String>> showMap = new HashMap<>();
                            for (Field field:
                                 clazz.getDeclaredFields()) {
                                CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                                if (cygProperty != null) {
                                    String show = cygProperty.show();
                                    String entityProp = cygProperty.entityProp();

                                    if (!StringUtils.isEmpty(show)) {
                                        if (showMap.get(show) != null) {
                                            List<String> list = showMap.get(show);
                                            if (!StringUtils.isEmpty(entityProp)) {
                                                list.add(entityProp);
                                            }
                                        } else {
                                            List<String> list = new ArrayList<>();
                                            showMap.put(show, list);
                                            if (!StringUtils.isEmpty(entityProp)) {
                                                list.add(entityProp);
                                            }
                                        }
                                    } else {
                                        if (showMap.get("show") != null) {
                                            List<String> list = showMap.get("show");
                                            if (!StringUtils.isEmpty(entityProp)) {
                                                list.add(entityProp);
                                            }
                                        } else {
                                            List<String> list = new ArrayList<>();
                                            showMap.put("show", list);
                                            if (!StringUtils.isEmpty(entityProp)) {
                                                list.add(entityProp);
                                            }
                                        }
                                    }
                                }
                            }
                            for (Map.Entry<String, List<String>> entry :
                                 showMap.entrySet()) {
                                String key = entry.getKey();
                                List<String> value = entry.getValue();

                                if (key.equals("show")) {
                                    for (String valueItem :
                                            value) {
                                        String[] split = valueItem.split("_");
                                        if (split.length == 1) {
                                            if (!"id".equals(split[0])) {
                                                functionSb.append("        queryModel.setShow(true);\n");
                                            }
                                        } else {
                                            List<CommonMapperGenerator.GeneratorModel1> list = CommonMapperGenerator.generatorModels_2;
                                            for (CommonMapperGenerator.GeneratorModel1 generatorModel1 :
                                                    list) {
                                                if (generatorModel1.getMainEntityClass().getSimpleName().equals(secondModel + "Entity")) {
                                                    List<String> propNames = new ArrayList<>();
                                                    for (int i = 0; i < split.length - 1; i++) {
                                                        propNames.add(split[i]);
                                                    }
                                                    Integer ser = CommonMapperGenerator.getSer(generatorModel1, propNames, 0);
                                                    if (ser != 0) {
                                                        String extDes = "";
                                                        for (String propName :
                                                        propNames) {
                                                            extDes += "_" + propName;
                                                        }
                                                        functionSb.append("        queryModel.setExt" + extDes + "(true);\n");
                                                        functionSb.append("        queryModel.setShow" + ser + "(true);\n");
                                                    }
                                                }
                                            }
                                        }
                                    }
                                } else {
                                    functionSb.append("        Boolean " + key + " = HzhrTypeUtil.object2boolean(query.get(\"" + key + "\"));\n");
                                    functionSb.append("        if (" + key + " != null && " + key + ") {\n");
                                    if (value.size() == 0) {
                                        functionSb.append("            queryModel.setShow(true);\n");
                                    } else {
                                        for (String valueItem :
                                                value) {
                                            String[] split = valueItem.split("_");
                                            if (split.length == 1) {
                                                functionSb.append("            queryModel.setShow(true);\n");
                                            } else {
                                                List<CommonMapperGenerator.GeneratorModel1> list = CommonMapperGenerator.generatorModels_2;
                                                for (CommonMapperGenerator.GeneratorModel1 generatorModel1 :
                                                        list) {
                                                    if (generatorModel1.getMainEntityClass().getSimpleName().equals(secondModel + "Entity")) {
                                                        List<String> propNames = new ArrayList<>();
                                                        for (int i = 0; i < split.length - 1; i++) {
                                                            propNames.add(split[i]);
                                                        }
                                                        Integer ser = CommonMapperGenerator.getSer(generatorModel1, propNames, 0);
                                                        if (ser != 0) {
                                                            String extDes = "";
                                                            for (String propName :
                                                                    propNames) {
                                                                extDes += "_" + propName;
                                                            }
                                                            functionSb.append("            queryModel.setExt" + extDes + "(true);\n");
                                                            functionSb.append("            queryModel.setShow" + ser + "(true);\n");
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    functionSb.append("        }\n");
                                }
                            }
                            functionSb.append("\n");
                            functionSb.append("        Integer page = HzhrTypeUtil.object2integer(query.get(\"_page\"));\n");
                            functionSb.append("        Integer count = HzhrTypeUtil.object2integer(query.get(\"_count\"));\n");
                            functionSb.append("        queryModel.setPage(page, count);\n");
                            functionSb.append("\n");
                            functionSb.append("        return queryModel;\n");
                            functionSb.append("    }\n");
                        }
                    }
                }

                String model = modelName.substring(0, modelName.lastIndexOf("Model"));
                Class<?> customQueryModelClass = null;
                try {
                    customQueryModelClass = Class.forName(rootPackageName + ".queryModel.custom." + model + "CustomQueryModel");
                } catch (Exception e) {

                }

                if (customQueryModelClass != null) {
                    importSb.append("import " + customQueryModelClass.getName() + ";\n");
                    functionSb.append("    public " + model + "CustomQueryModel " + "query2queryModel(Map<String, Object> query) {\n");
                    functionSb.append("        " + model + "CustomQueryModel queryModel = new " + model + "CustomQueryModel();\n");
                    functionSb.append("\n");

                    Class<?> controllerClass = null;
                    try {
                        controllerClass = Class.forName(rootPackageName + ".controller." + model + "Controller");
                    } catch (Exception e) {

                    }
                    if (controllerClass != null) {
                        CygQuerys cygQuerys = controllerClass.getAnnotation(CygQuerys.class);
                        if (cygQuerys != null) {
                            CygQuery[] cygQueries = cygQuerys.value();
                            for (CygQuery cygQuery : cygQueries) {
                                String name = cygQuery.name();
                                String query = cygQuery.query();
                                Class<?> type = cygQuery.type();

                                functionSb.append("        " + type.getSimpleName() + " " + name + " = HzhrTypeUtil.object2" + HzhrStringUtils.firstCharToLowerCase(type.getSimpleName()) + "(query.get(\"" + name + "\"));\n");
                                functionSb.append("        if (" + name + " != null) {\n");
                                functionSb.append("            queryModel.set" + HzhrStringUtils.firstCharToUppserCase(query) + "(" + name + ");\n");
                                functionSb.append("         }\n");
                                functionSb.append("\n");
                            }
                        }
                    }

                    Map<String, List<String>> showMap = new HashMap<>();
                    if (modelClass != null) {
                        for (Field field:
                                modelClass.getDeclaredFields()) {
                            CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                            if (cygProperty != null) {
                                String show = cygProperty.show();
                                String entityProp = cygProperty.entityProp();

                                if (!StringUtils.isEmpty(show)) {
                                    if (showMap.get(show) != null) {
                                        List<String> list = showMap.get(show);
                                        if (!StringUtils.isEmpty(entityProp)) {
                                            list.add(entityProp);
                                        }
                                    } else {
                                        List<String> list = new ArrayList<>();
                                        showMap.put(show, list);
                                        if (!StringUtils.isEmpty(entityProp)) {
                                            list.add(entityProp);
                                        }
                                    }
                                } else {
                                    if (showMap.get("show") != null) {
                                        List<String> list = showMap.get("show");
                                        if (!StringUtils.isEmpty(entityProp)) {
                                            list.add(entityProp);
                                        }
                                    } else {
                                        List<String> list = new ArrayList<>();
                                        showMap.put("show", list);
                                        if (!StringUtils.isEmpty(entityProp)) {
                                            list.add(entityProp);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    for (Map.Entry<String, List<String>> entry :
                            showMap.entrySet()) {
                        String key = entry.getKey();
                        List<String> value = entry.getValue();

                        if (key.equals("show")) {
                            for (String valueItem :
                                    value) {
                                String[] split = valueItem.split("_");
                                if (split.length == 1) {
                                    if (!"id".equals(split[0])) {
                                        functionSb.append("        queryModel.setShow(true);\n");
                                    }
                                } else {
                                    List<CommonMapperGenerator.GeneratorModel1> list = CommonMapperGenerator.generatorModels_2;
                                    for (CommonMapperGenerator.GeneratorModel1 generatorModel1 :
                                            list) {
                                        if (generatorModel1.getMainEntityClass().getSimpleName().equals(model + "Entity")) {
                                            List<String> propNames = new ArrayList<>();
                                            for (int i = 0; i < split.length - 1; i++) {
                                                propNames.add(split[i]);
                                            }
                                            Integer ser = CommonMapperGenerator.getSer(generatorModel1, propNames, 0);
                                            if (ser != 0) {
                                                String extDes = "";
                                                for (String propName :
                                                        propNames) {
                                                    extDes += "_" + propName;
                                                }
                                                functionSb.append("        queryModel.setExt" + extDes + "(true);\n");
                                                functionSb.append("        queryModel.setShow" + ser + "(true);\n");
                                            }
                                        }
                                    }
                                }
                            }
                        } else {
                            functionSb.append("        Boolean " + key + " = HzhrTypeUtil.object2boolean(query.get(\"" + key + "\"));\n");
                            functionSb.append("        if (" + key + " != null && " + key + ") {\n");
                            if (value.size() == 0) {
                                functionSb.append("            queryModel.setShow(true);\n");
                            } else {
                                for (String valueItem :
                                        value) {
                                    String[] split = valueItem.split("_");
                                    if (split.length == 1) {
                                        functionSb.append("            queryModel.setShow(true);\n");
                                    } else {
                                        List<CommonMapperGenerator.GeneratorModel1> list = CommonMapperGenerator.generatorModels_2;
                                        for (CommonMapperGenerator.GeneratorModel1 generatorModel1 :
                                                list) {
                                            if (generatorModel1.getMainEntityClass().getSimpleName().equals(model + "Entity")) {
                                                List<String> propNames = new ArrayList<>();
                                                for (int i = 0; i < split.length - 1; i++) {
                                                    propNames.add(split[i]);
                                                }
                                                Integer ser = CommonMapperGenerator.getSer(generatorModel1, propNames, 0);
                                                if (ser != 0) {
                                                    String extDes = "";
                                                    for (String propName :
                                                            propNames) {
                                                        extDes += "_" + propName;
                                                    }
                                                    functionSb.append("            queryModel.setExt" + extDes + "(true);\n");
                                                    functionSb.append("            queryModel.setShow" + ser + "(true);\n");
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            functionSb.append("        }\n");
                        }
                    }
                    functionSb.append("\n");
                    functionSb.append("        Integer page = HzhrTypeUtil.object2integer(query.get(\"_page\"));\n");
                    functionSb.append("        Integer count = HzhrTypeUtil.object2integer(query.get(\"_count\"));\n");
                    functionSb.append("        queryModel.setPage(page, count);\n");
                    functionSb.append("\n");
                    functionSb.append("        return queryModel;\n");
                    functionSb.append("    }\n");
                }

                functionSb.append("\n");
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();
                    if (!clazzName.equals(modelName) && clazzName.endsWith(modelName)) {
                        String classSimpleName = clazz.getSimpleName();
                        String[] classSimpleNameSplit = classSimpleName.split("_");
                        String firstName = classSimpleNameSplit[0];
                        String secondModel = classSimpleNameSplit[1].substring(0, classSimpleNameSplit[1].lastIndexOf("Model"));

                        Class<?> getModelClass = null;
                        try {
                            getModelClass = Class.forName(rootPackageName + ".model." + HzhrStringUtils.firstCharToLowerCase(secondModel) + "." + firstName + "_" + secondModel + "GetModel");
                        } catch (Exception e) {

                        }

                        if (getModelClass != null) {
                            String getModelSimpleName = getModelClass.getSimpleName();
                            importSb.append("import " + getModelClass.getName() + ";\n");
                            functionSb.append("    public " + getModelSimpleName + " " + firstName +"_extList2getModel(List<" + secondModel + "EntityExt> extList, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                            functionSb.append("        List<" + firstName + "_" + secondModel + "Model> modelList = " + firstName + "_extList2modelList(extList);\n");
                            functionSb.append("        if (modelList == null) {\n");
                            functionSb.append("            " + firstName + "_" + secondModel + "GetModel result = new " + firstName + "_" + secondModel + "GetModel();\n");
                            functionSb.append("            result.setTotal(total);\n");
                            functionSb.append("            result.setChangeCount(changeCount);\n");
                            functionSb.append("            return result;\n");
                            functionSb.append("        }\n");
                            functionSb.append("\n");

                            functionSb.append("         String _show = query.get(\"_show\") != null ? query.get(\"_show\").toString() : \"one\";\n");
                            Map<String, List<String>> showMap = new HashMap<>();
                            for (Field field:
                                    clazz.getDeclaredFields()) {
                                String fieldName = field.getName();
                                if (field.getType().getSimpleName().equals("Boolean") && fieldName.startsWith("is")) {
                                    fieldName = fieldName.substring(2);
                                }
                                CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                                if (cygProperty != null) {
                                    String show = cygProperty.show();

                                    if (!StringUtils.isEmpty(show)) {
                                        if (showMap.get(show) != null) {
                                            List<String> list = showMap.get(show);
                                            if (!StringUtils.isEmpty(fieldName)) {
                                                list.add(fieldName);
                                            }
                                        } else {
                                            List<String> list = new ArrayList<>();
                                            showMap.put(show, list);
                                            if (!StringUtils.isEmpty(fieldName)) {
                                                list.add(fieldName);
                                            }
                                        }
                                    }
                                }
                            }

                            for (Map.Entry<String, List<String>> entry :
                                showMap.entrySet()) {
                                String key = entry.getKey();
                                functionSb.append("         Boolean " + key + " = query.get(\"" + key + "\") != null ? Boolean.parseBoolean(query.get(\"" + key + "\").toString()) : false;\n");
                            }

                            functionSb.append("\n");

                            for (Map.Entry<String, List<String>> entry :
                                    showMap.entrySet()) {
                                String key = entry.getKey();
                                List<String> value = entry.getValue();
                                functionSb.append("        if (!" + key + ") {\n");
                                functionSb.append("            for (" + firstName + "_" + secondModel + "Model model : modelList) {\n");

                                for (String item:
                                     value) {
                                    functionSb.append("                model.set" + HzhrStringUtils.firstCharToUppserCase(item) + "(null);\n");
                                }
                                functionSb.append("            }\n");
                                functionSb.append("        }\n");
                            }

                            functionSb.append("\n");
                            functionSb.append("        " + getModelSimpleName + " result = new " + getModelSimpleName + "();\n");
                            functionSb.append("        if (\"one\".equals(_show)) {\n");
                            functionSb.append("            if (modelList.size() > 0) {\n");
                            functionSb.append("                result.setModel(modelList.get(0));\n");
                            functionSb.append("            }\n");
                            functionSb.append("         }\n");
                            functionSb.append("        if (\"list\".equals(_show)) {\n");
                            functionSb.append("            result.setModelList(modelList);\n");
                            functionSb.append("        }\n");
                            functionSb.append("        result.setTotal(total);\n");
                            functionSb.append("        result.setChangeCount(changeCount);\n");
                            functionSb.append("        return result;\n");
                            functionSb.append("    }\n");

                            functionSb.append("    public " + getModelSimpleName + " " + firstName + "_entity2getModel(" + secondModel + "Entity entity, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                            functionSb.append("        List<" + secondModel + "EntityExt> extList = new ArrayList<>();\n");
                            functionSb.append("        if (entity == null) return " + firstName + "_extList2getModel(extList, total, changeCount, query);\n");
                            functionSb.append("        extList.add(HzhrJsonUtil.convertObjectType(entity, " + secondModel + "EntityExt.class));\n");
                            functionSb.append("        return " + firstName + "_extList2getModel(extList, total, changeCount, query);\n");
                            functionSb.append("     }\n");
                        }
                    }
                }

                Class<?> getModelClass = null;
                try {
                    getModelClass = Class.forName(rootPackageName + ".model." + HzhrStringUtils.firstCharToLowerCase(model) + "." + model + "GetModel");
                } catch (Exception e) {

                }
                if (getModelClass != null) {
                    String getModelSimpleName = getModelClass.getSimpleName();
                    importSb.append("import " + getModelClass.getName() + ";\n");
                    functionSb.append("    public " + getModelSimpleName + " extList2getModel(List<" + model + "EntityExt> extList, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                    functionSb.append("        List<" + model + "Model> modelList = extList2modelList(extList);\n");
                    functionSb.append("        if (modelList == null) {\n");
                    functionSb.append("            " + model + "GetModel result = new " + model + "GetModel();\n");
                    functionSb.append("            result.setTotal(total);\n");
                    functionSb.append("            result.setChangeCount(changeCount);\n");
                    functionSb.append("            return result;\n");
                    functionSb.append("        }\n");
                    functionSb.append("\n");

                    functionSb.append("         String _show = query.get(\"_show\") != null ? query.get(\"_show\").toString() : \"one\";\n");
                    Map<String, List<String>> showMap = new HashMap<>();
                    for (Field field:
                            modelClass.getDeclaredFields()) {
                        String fieldName = field.getName();
                        if (field.getType().getSimpleName().equals("Boolean") && fieldName.startsWith("is")) {
                            fieldName = fieldName.substring(2);
                        }
                        CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                        if (cygProperty != null) {
                            String show = cygProperty.show();

                            if (!StringUtils.isEmpty(show)) {
                                if (showMap.get(show) != null) {
                                    List<String> list = showMap.get(show);
                                    if (!StringUtils.isEmpty(fieldName)) {
                                        list.add(fieldName);
                                    }
                                } else {
                                    List<String> list = new ArrayList<>();
                                    showMap.put(show, list);
                                    if (!StringUtils.isEmpty(fieldName)) {
                                        list.add(fieldName);
                                    }
                                }
                            }
                        }
                    }

                    for (Map.Entry<String, List<String>> entry :
                            showMap.entrySet()) {
                        String key = entry.getKey();
                        functionSb.append("         Boolean " + key + " = query.get(\"" + key + "\") != null ? Boolean.parseBoolean(query.get(\"" + key + "\").toString()) : false;\n");
                    }

                    functionSb.append("\n");

                    for (Map.Entry<String, List<String>> entry :
                            showMap.entrySet()) {
                        String key = entry.getKey();
                        List<String> value = entry.getValue();
                        functionSb.append("        if (!" + key + ") {\n");
                        functionSb.append("            for (" + model + "Model model : modelList) {\n");

                        for (String item:
                                value) {
                            functionSb.append("                model.set" + HzhrStringUtils.firstCharToUppserCase(item) + "(null);\n");
                        }
                        functionSb.append("            }\n");
                        functionSb.append("        }\n");
                    }

                    functionSb.append("\n");
                    functionSb.append("        " + getModelSimpleName + " result = new " + getModelSimpleName + "();\n");
                    functionSb.append("        if (\"one\".equals(_show)) {\n");
                    functionSb.append("            if (modelList.size() > 0) {\n");
                    functionSb.append("                result.setModel(modelList.get(0));\n");
                    functionSb.append("            }\n");
                    functionSb.append("         }\n");
                    functionSb.append("        if (\"list\".equals(_show)) {\n");
                    functionSb.append("            result.setModelList(modelList);\n");
                    functionSb.append("        }\n");
                    functionSb.append("        result.setTotal(total);\n");
                    functionSb.append("        result.setChangeCount(changeCount);\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");

                    functionSb.append("    public " + getModelSimpleName + " entity2getModel(" + model + "Entity entity, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                    functionSb.append("        List<" + model + "EntityExt> extList = new ArrayList<>();\n");
                    functionSb.append("        if (entity == null) return extList2getModel(extList, total, changeCount, query);\n");
                    functionSb.append("        extList.add(HzhrJsonUtil.convertObjectType(entity, " + model + "EntityExt.class));\n");
                    functionSb.append("        return extList2getModel(extList, total, changeCount, query);\n");
                    functionSb.append("     }\n");
                }


                importSb.append("\n");
                importSb.append("@Component\n");
                importSb.append("public class " + resourceName + "Convertor {\n");
                String content = importSb.toString() + autowireSb + "\n" + functionSb + "}\n";
                HzhrFileUtil.writeContent(srcRootPath + "\\convertor\\" + resourceName + "Convertor.java", content);


                //生成CustomConvertor
                String content1 = "package " + rootPackageName + ".convertor.custom;\n";
                content1 += "\n";
                content1 += "import " + rootPackageName + ".convertor." + resourceName + "Convertor;\n";
                content1 += "import org.springframework.stereotype.Service;\n";
                content1 += "\n";
                content1 += "@Service\n";
                content1 += "public class " + resourceName + "CustomConvertor extends " + resourceName + "Convertor {\n";
                content1 += "}\n";
                File file1 = new File(srcRootPath + "\\convertor\\custom\\" + resourceName + "CustomConvertor.java");
                if (!file1.exists()) {
                    HzhrFileUtil.writeContent(srcRootPath + "\\convertor\\custom\\" + resourceName + "CustomConvertor.java", content1);
                }
            }
        }


        //entityModel
        for (File file : files) {//遍历example
            String fileName = file.getName();
            if (fileName.endsWith("Entity.java")) {
                String resourceName = fileName.substring(0, fileName.lastIndexOf("Entity.java"));
                String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);

                Class entityClass = Class.forName(rootPackageName + ".entity." + resourceName + "Entity");
                Class extClass = null;
                try {
                    extClass = Class.forName(rootPackageName + ".entity.ext." + resourceName + "EntityExt");
                } catch (Exception e) {

                }
                Class modelClass = null;
                try {
                    modelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityModel");
                } catch (Exception e) {

                }
                Class postModelClass = null;
                try {
                    postModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityPostModel");
                } catch (Exception e) {

                }
                Class putModelClass = null;
                try {
                    putModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityPutModel");
                } catch (Exception e) {

                }
                Class patchModelClass = null;
                try {
                    patchModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityPatchModel");
                } catch (Exception e) {

                }
                Class dto_addClass = null;
                try {
                    dto_addClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_add");
                } catch (Exception e) {

                }
                Class dto_setClass = null;
                try {
                    dto_setClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_set");
                } catch (Exception e) {

                }
                Class addDtoClass = null;
                try {
                    addDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "AddDto");
                } catch (Exception e) {

                }
                Class setDtoClass = null;
                try {
                    setDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "SetDto");
                } catch (Exception e) {

                }
                Class delDtoClass = null;
                try {
                    delDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".del." + resourceName + "DelRequestDto");
                } catch (Exception e) {

                }
                Class setPropsDtoClass = null;
                try {
                    setPropsDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".setProps." + resourceName + "SetPropsRequestDto");
                } catch (Exception e) {

                }
                Class getDtoClass = null;
                try {
                    getDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".get." + resourceName + "GetRequestDto");
                } catch (Exception e) {

                }
                Class getByIdDtoClass = null;
                try {
                    getByIdDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".getById." + resourceName + "GetByIdRequestDto");
                } catch (Exception e) {

                }
                Class getCountDtoClass = null;
                try {
                    getCountDtoClass = Class.forName(rootPackageName + ".dto." + resourceNameFl + ".getCount." + resourceName + "GetCountRequestDto");
                } catch (Exception e) {

                }

                StringBuilder sb = new StringBuilder();
                StringBuilder importSb = new StringBuilder();
                importSb.append("package " + rootPackageName + ".convertor;\n\n");
                importSb.append("import " + rootPackageName + ".convertor.custom.*;\n");
                if (modelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityModel;\n");
                }
                if (postModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityPostModel;\n");
                }
                if (putModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityPutModel;\n");
                }
                if (patchModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "EntityPatchModel;\n");
                }
                if (dto_addClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_add;\n");
                }
                if (dto_setClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "Dto_set;\n");
                }
                if (addDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "AddDto;\n");
                }
                if (setDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + "." + resourceName + "SetDto;\n");
                }
                if (delDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".del." + resourceName + "DelRequestDto;\n");
                }
                if (getDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".get." + resourceName + "GetRequestDto;\n");
                }
                if (getByIdDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".getById." + resourceName + "GetByIdRequestDto;\n");
                }
                if (getCountDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".getCount." + resourceName + "GetCountRequestDto;\n");
                }
                if (setPropsDtoClass != null) {
                    importSb.append("import " + rootPackageName + ".dto." + resourceNameFl + ".setProps." + resourceName + "SetPropsRequestDto;\n");
                }
                importSb.append("import " + rootPackageName + ".entity." + resourceName + "Entity;\n");
                if (extClass != null) {
                    importSb.append("import " + rootPackageName + ".entity.ext." + resourceName + "EntityExt;\n");
                }
                //importSb.append("import " + rootPackageName + ".queryModel.custom." + resourceName + "CustomQueryModel;\n");
                importSb.append("import org.springframework.beans.factory.annotation.Autowired;\n");
                importSb.append("import org.springframework.stereotype.Component;\n");
                importSb.append("import java.util.ArrayList;\n");
                importSb.append("import java.util.Date;\n");
                importSb.append("import java.util.List;\n");

                StringBuilder autowireSb = new StringBuilder();
                for (File file1 : files) {//遍历example
                    String fileName1 = file1.getName();
                    if (fileName1.endsWith("Entity.java")) {
                        String resourceName1 = fileName1.substring(0, fileName1.lastIndexOf("Entity.java"));
                        if (resourceName.equals(resourceName1)) continue;
                        String resourceNameFl1 = HzhrStringUtils.firstCharToLowerCase(resourceName1);
                        autowireSb.append("    @Autowired\n");
                        autowireSb.append("    " + resourceName1 + "EntityCustomConvertor " + resourceNameFl1 + "EntityCustomConvertor;\n");
                    }
                }
                StringBuilder functionSb = new StringBuilder();



                if (postModelClass != null) {
                    functionSb.append("    public " + resourceName + "Entity postModel2entity(" + resourceName + "EntityPostModel in) {\n");
                    functionSb.append(generate(postModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public List<" + resourceName + "Entity> postModelList2entityList(List<" + resourceName + "EntityPostModel> in) {\n");
                    functionSb.append("        List<" + resourceName + "Entity> result = new ArrayList<>();\n");
                    functionSb.append("        for (" + resourceName + "EntityPostModel item : in) {\n");
                    functionSb.append("            result.add(postModel2entity(item));\n");
                    functionSb.append("        }\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");
                }

                if (putModelClass != null) {
                    functionSb.append("    public void putModel2entity(" + resourceName + "Entity result, " + resourceName + "EntityPutModel in) {\n");
                    functionSb.append(generate1(putModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
//                    functionSb.append("    public void putModelList2entityList(List<" + resourceName + "Entity> result, List<" + resourceName + "EntityPutModel> in) {\n");
//                    functionSb.append("        if (in == null) return null;\n");
//                    functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
//                    functionSb.append("            " + resourceName + "EntityPutModel ini = in.get(i);\n");
//                    functionSb.append("            Integer id = ini.getId();\n");
//                    functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
//                    functionSb.append("                if (item.getId() == id) {\n");
//                    functionSb.append("                    putModel2entity(item, ini);\n");
//                    functionSb.append("                    break;\n");
//                    functionSb.append("                }\n");
//                    functionSb.append("            }\n");
//                    functionSb.append("        }\n");
//                    functionSb.append("    }\n");
                }

                if (patchModelClass != null) {
                    functionSb.append("    public void patchModel2entity(" + resourceName + "Entity result, " + resourceName + "EntityPatchModel in) {\n");
                    functionSb.append(generate2(patchModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public void patchModelList2entityList(List<" + resourceName + "Entity> result, List<" + resourceName + "EntityPatchModel> in) {\n");
                    functionSb.append("        if (in == null) return null;\n");
                    functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
                    functionSb.append("            " + resourceName + "EntityPatchModel ini = in.get(i);\n");
                    functionSb.append("            Integer id = ini.getId();\n");
                    functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
                    functionSb.append("                if (item.getId() == id) {\n");
                    functionSb.append("                    patchModel2entity(item, ini);\n");
                    functionSb.append("                    break;\n");
                    functionSb.append("                }\n");
                    functionSb.append("            }\n");
                    functionSb.append("        }\n");
                    functionSb.append("    }\n");
                }

                Set<Class<?>> classes = ReflectUtil.getClasses(rootPackageName + ".model." + resourceNameFl);
                String postModelName = resourceName + "EntityPostModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(postModelName) && clazzName.endsWith(postModelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(postModelName));
                        functionSb.append("    public " + resourceName + "Entity " + pre + "postModel2entity(" + clazzName + " in) {\n");
                        functionSb.append(generate(clazz, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + resourceName + "Entity> " + pre + "postModelList2entityList(List<" + clazzName + "> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + resourceName + "Entity> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + clazzName + " item : in) {\n");
                        functionSb.append("            result.add(" + pre + "postModel2entity(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");
                    }
                }

                String putModelName = resourceName + "EntityPutModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(putModelName) && clazzName.endsWith(putModelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(putModelName));
                        functionSb.append("    public void " + pre + "putModel2entity(" + resourceName + "Entity result, " + clazzName + " in) {\n");
                        functionSb.append(generate1(putModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
//                        functionSb.append("    public void putModelList2entityList(List<" + resourceName + "Entity> result, List<" + clazzName + "> in) {\n");
//                        functionSb.append("        if (in == null) return null;\n");
//                        functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
//                        functionSb.append("            " + clazzName + " ini = in.get(i);\n");
//                        functionSb.append("            Integer id = ini.getId();\n");
//                        functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
//                        functionSb.append("                if (item.getId() == id) {\n");
//                        functionSb.append("                    putModel2entity(item, ini);\n");
//                        functionSb.append("                    break;\n");
//                        functionSb.append("                }\n");
//                        functionSb.append("            }\n");
//                        functionSb.append("        }\n");
//                        functionSb.append("    }\n");
                    }
                }

                String patchModelName = resourceName + "EntityPatchModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(patchModelName) && clazzName.endsWith(patchModelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(patchModelName));
                        functionSb.append("    public void " + pre + "patchModel2entity(" + resourceName + "Entity result, " + clazzName + " in) {\n");
                        functionSb.append(generate1(putModelClass, entityClass, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public void patchModelList2entityList(List<" + resourceName + "Entity> result, List<" + clazzName + "> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        for (int i = 0; i < in.size(); i++) {\n");
                        functionSb.append("            " + clazzName + " ini = in.get(i);\n");
                        functionSb.append("            Integer id = ini.getId();\n");
                        functionSb.append("            for (" + resourceName + "Entity item : result) {\n");
                        functionSb.append("                if (item.getId() == id) {\n");
                        functionSb.append("                    patchModel2entity(item, ini);\n");
                        functionSb.append("                    break;\n");
                        functionSb.append("                }\n");
                        functionSb.append("            }\n");
                        functionSb.append("        }\n");
                        functionSb.append("    }\n");
                    }
                }

                functionSb.append("\n");

                if (modelClass != null) {
                    functionSb.append("    public " + resourceName + "EntityModel entity2model(" + resourceName + "Entity in) {\n");
                    functionSb.append(generate(entityClass, modelClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public List<" + resourceName + "EntityModel> entityList2modelList(List<" + resourceName + "Entity> in) {\n");
                    functionSb.append("        if (in == null) return null;\n");
                    functionSb.append("        List<" + resourceName + "EntityModel> result = new ArrayList<>();\n");
                    functionSb.append("        for (" + resourceName + "Entity item : in) {\n");
                    functionSb.append("            result.add(entity2model(item));\n");
                    functionSb.append("        }\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");

                    functionSb.append("    public " + resourceName + "EntityModel ext2model(" + resourceName + "EntityExt in) {\n");
                    functionSb.append(generate(extClass, modelClass, resourceName, "HzhrTypeUtil"));
                    functionSb.append("    }\n");
                    functionSb.append("    public List<" + resourceName + "EntityModel> extList2modelList(List<" + resourceName + "EntityExt> in) {\n");
                    functionSb.append("        if (in == null) return null;\n");
                    functionSb.append("        List<" + resourceName + "EntityModel> result = new ArrayList<>();\n");
                    functionSb.append("        for (" + resourceName + "EntityExt item : in) {\n");
                    functionSb.append("            result.add(ext2model(item));\n");
                    functionSb.append("        }\n");
                    functionSb.append("        return result;\n");
                    functionSb.append("    }\n");
                }

                String modelName = resourceName + "EntityModel";
                for (Class<?> clazz : classes) {
                    String clazzName = clazz.getSimpleName();

                    if (!clazzName.equals(modelName) && clazzName.endsWith(modelName)) {
                        importSb.append("import " + clazz.getName() + ";\n");
                        String pre = clazzName.substring(0, clazzName.indexOf(modelName));
                        functionSb.append("    public " + clazzName + " " + pre + "entity2model(" + resourceName + "Entity in) {\n");
                        functionSb.append(generate(entityClass, clazz, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + clazzName + "> " + pre + "entityList2modelList(List<" + resourceName + "Entity> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + clazzName + "> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + resourceName + "Entity item : in) {\n");
                        functionSb.append("            result.add(" + pre + "entity2model(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");

                        functionSb.append("    public " + clazzName + " " + pre + "ext2model(" + resourceName + "EntityExt in) {\n");
                        functionSb.append(generate(extClass, clazz, resourceName, "HzhrTypeUtil"));
                        functionSb.append("    }\n");
                        functionSb.append("    public List<" + clazzName + "> " + pre + "extList2modelList(List<" + resourceName + "EntityExt> in) {\n");
                        functionSb.append("        if (in == null) return null;\n");
                        functionSb.append("        List<" + clazzName + "> result = new ArrayList<>();\n");
                        functionSb.append("        for (" + resourceName + "EntityExt item : in) {\n");
                        functionSb.append("            result.add(" + pre + "ext2model(item));\n");
                        functionSb.append("        }\n");
                        functionSb.append("        return result;\n");
                        functionSb.append("    }\n");
                    }
                }

                importSb.append("\n");
                importSb.append("@Component\n");
                importSb.append("public class " + resourceName + "EntityConvertor {\n");
                String content = importSb.toString() + autowireSb + "\n" + functionSb + "}\n";
                HzhrFileUtil.writeContent(srcRootPath + "\\convertor\\" + resourceName + "EntityConvertor.java", content);


                //生成CustomConvertor
                String content1 = "package " + rootPackageName + ".convertor.custom;\n";
                content1 += "\n";
                content1 += "import " + rootPackageName + ".convertor." + resourceName + "EntityConvertor;\n";
                content1 += "import org.springframework.stereotype.Service;\n";
                content1 += "\n";
                content1 += "@Service\n";
                content1 += "public class " + resourceName + "EntityCustomConvertor extends " + resourceName + "EntityConvertor {\n";
                content1 += "}\n";
                File file1 = new File(srcRootPath + "\\convertor\\custom\\" + resourceName + "EntityCustomConvertor.java");
                if (!file1.exists()) {
                    HzhrFileUtil.writeContent(srcRootPath + "\\convertor\\custom\\" + resourceName + "EntityCustomConvertor.java", content1);
                }
            }
        }
    }

    public static String generate3(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "";

        content += "        if (in == null) return null;\n";
        content += "        " + classbSimpleName + " result = new " + classbSimpleName + "();\n";
        content += "\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field : classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (fieldName.equals(fieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }

                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
        content += "        return result;\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate1(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "        if (result == null) return;\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field:classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (fieldName.equals(fieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate2(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "        if (result == null) return;\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field:classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (fieldName.equals(fieldName1)) {
                        content += "        if (in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "() != null) {\n";
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "           result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "                result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                        content += "        }\n";
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);

        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "";

        content += "        if (in == null) return null;\n";
        content += "        " + classbSimpleName + " result = new " + classbSimpleName + "();\n";
        content += "\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field : classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String entityFieldName = null;
                CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                if (cygProperty != null) {
                    entityFieldName = cygProperty.entityProp();
                } else {
                    entityFieldName = fieldName;
                }
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String entityFieldName1 = null;
                    CygProperty cygProperty1 = field1.getAnnotation(CygProperty.class);
                    if (cygProperty1 != null) {
                        entityFieldName1 = cygProperty1.entityProp();
                    } else {
                        entityFieldName1 = fieldName1;
                    }
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (entityFieldName.equals(entityFieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldName1.startsWith("is")) {
                                fieldName1 = fieldName1.substring(2);
                            }
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
        content += "        return result;\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    /**
     * 判断field是否是java基础类型
     * @param field
     * @return
     */
    private static boolean checkType(Field field) {
//        String typeName = field.getType().getName();
//        if (typeName.startsWith("java")) {
//            return true;
//        } else {
//            return false;
//        }
        return true;
    }
}
